package com.aaa.java03;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/7/4 17:14
 * @description：人类
 * @modified By：
 * @version:
 */
public class Person {
    String  name;
    int age;
    String sex;
    float height;
    float weight;

    /**
     * @create by: Teacher陈（86521760@qq.com）
     * @description: 判断两人是否能够结婚
     * @create time: 2022/7/4 17:18
     * @param other
     * @return boolean
     */
    public  boolean isMarry(Person other){

        if(other.age==18&&other.sex!=this.sex&&other.height>160&&other.weight<200){
            return true;
        }else
        {
            return false;
        }
    }


    public static void main(String[] args) {
        Person me= new Person();
        me.name="姚建军";
        me.age=21;
        me.sex="男";
        me.weight=129;
        me.height=179;
        Person you= new Person();
        you.name="李世界";
        you.age=18;
        you.sex="男";
        you.weight=169;
        you.height=165;

        boolean marry = me.isMarry(you);
        if(marry){
            System.out.println("早生贵子");
        }else
        {
            System.out.println("来生再见");
        }


    }
}
